package cn.com.wantools.module.nas.service;

import cn.com.wantools.module.nas.model.FileNode;
import cn.com.wantools.module.nas.model.FileNodeList;
import cn.com.wantools.module.nas.model.PageExt;
import com.aliyun.oss.OSS;
import com.jfinal.plugin.activerecord.Page;

public interface NasService {

    public OSS createOssClient();

    /**
     * 按照文件夹下列文件和子文件夹
     * @param path
     * @param pageIndex
     * @param pageSize
     * @return Page<FileNode>
     */
    public Page<FileNode> pageFileNodes(OSS ossClient, String path, Integer pageIndex, Integer pageSize, Integer totalSize, String nextContinuationToken);

    public FileNodeList listFileNodes(OSS ossClient, String path, Integer pageSize, String nextContinuationToken);

    /**
     * 查询文件夹下的文件数量
     * @param path
     * @return int
     */
    public int listFileCount(OSS ossClient, String path);

    /**
     * 查询文件夹下的所有文件数量
     * @param path
     * @return int
     */
    public int listFileCountWithSubFolder(OSS ossClient, String path);

    /**
     * 查询文件夹下所有的文件
     * @param path
     * @return
     */
    public PageExt<FileNode> listAllFileNodesWithSubFolder(OSS ossClient, String path, Integer pageIndex, Integer pageSize, Integer totalSize, String nextContinuationToken);

    public String showImageUrl(OSS ossClient, String path, Boolean smallType);

    public String showDocFileUrl(OSS ossClient, String path);

    public String showMediaUrl(OSS ossClient, String path);

    public String showFileUrl(OSS ossClient, String path);

    public String getETag(OSS ossClient, String path);

    public void shutdownOss(OSS ossClient);
}
